<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<!-- In order to adapt these examples to your test setup you will need to change the domain names to your test servers -->
<!-- Lines that need to be adapted are marked with CHANGE_DOMAIN in this document as well as iframe.html and iframe2.html -->

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>xssinterface Demo</title>

<script type="text/javascript" src="/xssinterface/js/json2.js"></script>
<script type="text/javascript" src="/xssinterface/js/xssinterface.js"></script>


<script type="text/javascript">


function bind() {
	// CHANGE_DOMAIN
	window.xssCaller1 = new XSSInterface.Caller("www.avantaxx.net","/xssinterface/html/cookie_setter.html","iframe1");
	// CHANGE_DOMAIN
	window.xssCaller2 = new XSSInterface.Caller("www.avantaxx.net","/xssinterface/html/cookie_setter.html","iframe2");
}

function sayHello(which) {

	var message = $('input').value;
	var color   = $('color').options[$('color').selectedIndex].value;

	window["xssCaller"+which].call("hello", message, color)
}

function $(id) {
	return document.getElementById(id)
}


</script>

</head>

<body onload="bind(); ">
<h1>xssinterface Demo</h1>


<ul>
  <li>
    Click a send-Button
  </li>
  <li>
    If you have trouble, see the <a href="http://code.google.com/p/xssinterface/wiki/BrowserIssues">browser issue page</a>
  </li>
</ul>

<form>

<table border="1">
  <tr>
    <td width="97">My Domain</td>
    <td width="287">
      <b><script type="text/javascript">
      document.write(document.location.hostname)
	  </script></b>
    </td>
  </tr>
  <tr>
    <td width="97">Input</td>
    <td width="287">
     Text: <input type="text" name="input" id="input" value="Hello World" /><br />
     Color:
     <select id="color">
       <option value="red">red</option>
       <option value="yellow">yellow</option>
       <option value="blue">blue</option>
       <option value="green">green</option>
     </select> 
		<br />
     <input type="button" value="send to 1" onclick="sayHello(1)" />
     <input type="button" value="send to 2" onclick="sayHello(2)" /></td>
  </tr>
  <tr>
    <td>IFrame 1</td>
    <!-- CHANGE_DOMAIN -->
    <td><iframe src="http://www.avantaxx.net/xssinterface/examples/basic/iframe.html" width="500" height=200 id="iframe1" name="iframe1"></iframe></td>
  </tr>
  <tr>
    <td>IFrame 2</td>
    <!-- CHANGE_DOMAIN -->
    <td><iframe src="http://www.avantaxx.net/xssinterface/examples/basic/iframe2.html" width="500" height=200 id="iframe2" name="iframe2"></iframe></td>
  </tr>
</table>



<div id="setter"></div>
<div id="log"></div>

</form>

</body>
</html>